package com.tanhua.model.vo;

import com.tanhua.model.mongo.PeachBlossom;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class PeachblossomSoundVo implements Serializable {


    private Integer id;                //用户id
    private String avatar;          //头像
    private String nickname;        //昵称
    private String gender;          //性别 man woman
    private Integer age;               //年龄
    private String soundUrl;        //语音地址
    private Integer remainingTimes;    //剩余次数


    public static PeachblossomSoundVo init(PeachBlossom peachBlossom){
        PeachblossomSoundVo vo = new PeachblossomSoundVo();
        vo.setId(peachBlossom.getUserId().intValue());
        vo.setAvatar(peachBlossom.getAvatar());
        vo.setSoundUrl(peachBlossom.getSoundUrl());
        vo.setAge(peachBlossom.getAge().intValue());
        vo.setGender(peachBlossom.getGender());
        vo.setNickname(peachBlossom.getNickname());

        return vo;
    }
}
